package com.example.ui.fragment;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;


import com.example.administrator.sharker_demo.R;
import com.example.ui.activity.AccountActivity;
import com.example.ui.activity.BaseActivity;
import com.example.ui.activity.CollectionActivity;
import com.example.ui.activity.DownloadActivity;
import com.example.ui.activity.MessageActivity;
import com.example.ui.activity.PhoneActivity;
import com.example.ui.activity.PurchaseActivity;
import com.example.ui.activity.SettingActivity;
import com.example.ui.activity.UserActivity;

import static com.example.App.getAllFragment;


/**
 * 董建业  时间:2017/4/10.
 * 我的
 */

public class Minefragment extends TransitionFragment implements View.OnClickListener {

    private LinearLayout ll_user;
    private LinearLayout ll_download;
    private LinearLayout ll_account;
    private LinearLayout ll_message;
    private LinearLayout ll_setting;
    private LinearLayout ll_phone;
    private LinearLayout ll_collection;
    private LinearLayout ll_purchase;
    private ImageView my_back;

    @Override
    public int getlayoutid() {
        return R.layout.fragment_mine;
    }

    @Override
    protected void initview(View view) {
        ll_user = (LinearLayout) view.findViewById(R.id.ll_user);
        ll_download = (LinearLayout) view.findViewById(R.id.ll_download);
        ll_account = (LinearLayout) view.findViewById(R.id.ll_account);
        ll_message = (LinearLayout) view.findViewById(R.id.ll_message);
        ll_setting = (LinearLayout) view.findViewById(R.id.ll_setting);
        ll_phone = (LinearLayout) view.findViewById(R.id.ll_phone);
        ll_collection = (LinearLayout) view.findViewById(R.id.ll_collection);
        ll_purchase = (LinearLayout) view.findViewById(R.id.ll_purchase);
        my_back = (ImageView) view.findViewById(R.id.my_back);

        ll_user.setOnClickListener(this);
        ll_download.setOnClickListener(this);
        ll_collection.setOnClickListener(this);
        ll_account.setOnClickListener(this);
        ll_message.setOnClickListener(this);
        ll_phone.setOnClickListener(this);
        ll_setting.setOnClickListener(this);
        ll_purchase.setOnClickListener(this);
        my_back.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {

        switch (v.getId()) {
            case R.id.ll_user:
                Intent intent1 = new Intent(getContext(), UserActivity.class);
                startActivity(intent1);
                break;
            case R.id.ll_download:
                Intent intent2 = new Intent(getContext(), DownloadActivity.class);
                startActivity(intent2);
                break;
            case R.id.ll_collection:
                Intent intent3 = new Intent(getContext(), CollectionActivity.class);
                startActivity(intent3);
                break;
            case R.id.ll_account:
                Intent intent4 = new Intent(getContext(), AccountActivity.class);
                startActivity(intent4);
                break;
            case R.id.ll_purchase:
                Intent intent5 = new Intent(getContext(), PurchaseActivity.class);
                startActivity(intent5);
                break;
            case R.id.ll_message:
                Intent intent6 = new Intent(getContext(), MessageActivity.class);
                startActivity(intent6);
                break;
            case R.id.ll_setting:
                Intent intent7 = new Intent(getContext(), SettingActivity.class);
                startActivity(intent7);
                break;
            case R.id.ll_phone:
                Intent intent8 = new Intent(getContext(), PhoneActivity.class);
                startActivity(intent8);
                break;
            case R.id.my_back:
                BaseActivity baseActivity= (BaseActivity) getActivity();
                baseActivity.isreturn();
        }

    }


}



